CC = g++

FFTWLIB = -lfftw3
CFLAGS = -O3
LDFLAGS = -lm

SPH_DES=sphdes

# for semi-naive
SEMIOBJ = pmls.o cospmls.o seminaive.o primitive.o makeweights.o

# seminaive spherical transform and convolution
FSTSEMIOBJ = $(SEMIOBJ) naive_synthesis.o

CONVSEMIOBJ = $(FSTSEMIOBJ)

$(SPH_DES): $(FSTSEMIOBJ) FST_semi_memo.o $(SPH_DES).o
	$(CC) $(CFLAGS) $(FSTSEMIOBJ) FST_semi_memo.o $(SPH_DES).o ${FFTWLIB} $(LDFLAGS) -o $(SPH_DES)

# and now for LOTS OF dependencies
# FST_semi_fly.o: primitive.h makeweights.h pmls.h cospmls.h naive_synthesis.h
# FST_semi_fly.o: seminaive.h FST_semi_fly.h

FST_semi_memo.o: makeweights.h FST_semi_memo.h
FST_semi_memo.o: cospmls.h primitive.h naive_synthesis.h seminaive.h
cospmls.o: primitive.h pmls.h
pmls.o: primitive.h
seminaive.o: cospmls.h
$(SPH_DES).o: makeweights.h cospmls.h FST_semi_memo.h 

clean: 
	rm *.o

